package com.yamaikj.controller;

import com.yamaikj.model.Goods;
import com.yamaikj.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @description:
 * @author: swj
 * @time: 2020/3/17 14:37
 */
@Controller
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @RequestMapping(value = "/save")
    @ResponseBody
    public String save(){
        Goods goods = new Goods();
        goods.setGoodsName("测试1");
        goodsService.save(goods);
        return "ok";
    }

}
